package com.jet.merchant.remote.cashier;

import com.jet.core.exception.CustomException;
import com.jet.core.result.ResultJson;
import com.jet.merchant.remote.cashier.vo.CashierModeVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author dcl
 * @since 2025/4/29 10:07
 */
@Service
@Slf4j
public class MerchantCashierRemote {

    @Resource
    private MerchantCashierRemoteFeign merchantCashierRemoteFeign;

    public CashierModeVo getCashierMode(long merchantNo, long storeNo, String accountId) {
        ResultJson<CashierModeVo> result = merchantCashierRemoteFeign.getCashierMode(merchantNo, storeNo, accountId);
        if (result.getCode() != ResultJson.ok().getCode()) {
            log.error("获取收银台模式信息异常，{}", result.getMsg());
            throw new CustomException(result.getMsg());
        }
        return result.getData();
    }
}
